import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('@/views/Login.vue')
    },
    {
      path: '/index',
      name: 'index',
      component: () => import('@/views/Index.vue'),
      children: [
        {
          path: 'home',
          name: 'home',
          component: () => import('@/views/Home.vue')
        }
      ]
    },
    {
      path: '/other',
      name: 'other',
      component: () => import('@/views/Index.vue'),
      children: [
        {
          path: 'personalCenter',
          name: 'personalCenter',
          component: () => import('@/views/Other/PersonalCenter.vue')
        },
        {
          path: 'propertyInfo',
          name: 'propertyInfo',
          component: () => import('@/views/Other/PropertyInfo.vue')
        },
        {
          path: 'auntsAssistant',
          name: 'auntsAssistant',
          component: () => import('@/components/Explore/AuntSAssistant.vue'),
        },
       ]
    },
    {
      path: '/tenement',
      name: 'tenement',
      component: () => import('@/views/Index.vue'),
      children: [
        {
          path: 'worker',
          name: 'worker',
          component: () => import('@/views/Tenement/Worker.vue')
        },
        {
          path: 'post',
          name: 'post',
          component: () => import('@/views/Tenement/Post.vue')
        },
        {
          path: 'dept',
          name: 'dept',
          component: () => import('@/views/Tenement/Dept.vue')
        },
        {
          path: 'house',
          name: 'house',
          component: () => import('@/views/Tenement/House.vue')
        },
        {
          path: 'repair',
          name: 'repair',
          component: () => import('@/views/Tenement/Repair.vue')
        },
        {
          path: 'notice',
          name: 'notice',
          component: () => import('@/views/Tenement/Notice.vue')
        },
        {
          path: 'resolution',
          name: 'resolution',
          component: () => import('@/views/Tenement/Resolution.vue')
        }
      ]
    },
    {
      path: '/system',
      name: 'system',
      component: () => import('@/views/Index.vue'),
      children: [
        {
          path: 'menu',
          name: 'menu',
          component: () => import('@/views/System/Menu.vue')
        },
        {
          path: 'user',
          name: 'user',
          component: () => import('@/views/System/User.vue')
        },
        {
          path: 'role',
          name: 'role',
          component: () => import('@/views/System/Role.vue')
        },
        {
          path: 'property',
          name: 'property',
          component: () => import('@/views/System/Property.vue')
        }
      ]
    }
  ]
})

export default router
